#ifndef _CEGUIDragIcon_h__
#define _CEGUIDragIcon_h__

#pragma once

#include "CEGUIWindow.h"
#include "CEGUIWindowFactory.h"
#include "elements/CEGUIDragContainer.h"
#include "elements/CEGUIDragIcon.h"

#if defined(_MSC_VER)
#	pragma warning(push)
#	pragma warning(disable : 4251)
#endif

// Start of CEGUI namespace section
namespace CEGUI
{
	class CEGUIEXPORT DragIcon : public DragContainer
	{
	public:
		static const String WidgetTypeName;
		static const String EventNamespace;

		static const String EventClicked;

		DragIcon(const String& type, const String& name);
		virtual ~DragIcon(void);

		bool isHovering(void) const { return d_hovering; }
		bool isPushed(void) const {return d_pushed; }
		
	protected:
		virtual void	onClicked(WindowEventArgs& e);

		virtual void	onMouseMove(MouseEventArgs& e);
		virtual void	onMouseButtonDown(MouseEventArgs& e);
		virtual void	onMouseButtonUp(MouseEventArgs& e);
		virtual void	onCaptureLost(WindowEventArgs& e);
		virtual void	onMouseLeaves(MouseEventArgs& e);

		void	updateInternalState(const Point& mouse_pos);

		virtual bool	testClassName_impl(const String& class_name) const
		{
			if (class_name=="DragIcon")	return true;
			return DragContainer::testClassName_impl(class_name);
		}

		bool d_pushed;
		bool d_hovering;

	};
}


#endif // _CEGUIDragIcon_h__
